<cp-navbar (onClickLeft)="onClickLeft()" [border]="loading"></cp-navbar>
<div class="error" *ngIf="error"><cp-error (reload)="handleReload()"></cp-error></div>
<div class="loading" *ngIf="loading"><cp-loading></cp-loading></div>
<div class="container" *ngIf="!error && !loading">
  <cp-tab [items]="tabs" [itemWidth]="64" (onTabChange)="handleTabChange($event)"></cp-tab>
  <div class="content">
    <!-- 我的提问 -->
    <div class="question" [class.hide]="active !== 0">
      <div class="list" *ngIf="question.length > 0">
        <div class="gutter"></div>
        <div
          class="item"
          *ngFor="let item1 of question"
          routerLink="/workspace/estate/questionDetail"
          [queryParams]="{ project: item1.Id }"
        >
          <p class="q">{{ item1.Content }}</p>
          <p class="a" *ngIf="item1.AnswerCount > 0">{{ item1.Answer }}</p>
          <div class="footer">
            <span class="num" *ngIf="item1.AnswerCount > 0">{{ item1.AnswerCount }}个回答</span>
            <span class="num" *ngIf="item1.AnswerCount === 0">暂无回答</span>
            <span class="time">更新于{{ item1.DateTime }}</span>
          </div>
        </div>
      </div>
      <cp-loadmore *ngIf="question.length > 0 && !questionNomore"></cp-loadmore>
      <cp-nomore *ngIf="question.length > 4 && questionNomore"></cp-nomore>
      <div class="empty" *ngIf="question.length === 0"><cp-empty></cp-empty></div>
    </div>
    <!-- 我的回答 -->
    <div class="answer" [class.hide]="active !== 1">
      <div class="list" *ngIf="answer.length > 0">
        <div class="gutter"></div>
        <div
          class="item"
          *ngFor="let item2 of answer"
          routerLink="/workspace/estate/questionDetail"
          [queryParams]="{ project: item2.Question }"
        >
          <p class="q">{{ item2.QuestionInfo.Content }}</p>
          <p class="a">{{ item2.Content }}</p>
          <div class="footer">
            <span class="num">{{ item2.QuestionInfo.Count }}个回答</span>
            <span class="time">更新与{{ item2.UpdateTime }}</span>
          </div>
        </div>
      </div>
      <cp-loadmore *ngIf="answer.length > 0 && !answerNomore"></cp-loadmore>
      <cp-nomore *ngIf="answer.length > 4 && answerNomore"></cp-nomore>
      <div class="empty" *ngIf="answer.length === 0"><cp-empty></cp-empty></div>
    </div>
  </div>
</div>
